//
//  BQBaseDao.h
//  honeycomb
//
//  Created by billionsfinance-resory on 16/2/26.
//  Copyright © 2016年 www.bqjr.cn. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BQBaseRequest.h"

typedef void(^serverResponseSuccess)(id response);
typedef void(^serverResponseFailed)(id response);

@interface BQBaseDao : NSObject
/**
 *  单例
 *
 *  @return 对象
 */
+ (id)shareObject;

/**
 *  发起普通网络请求
 *
 *  @param netWorkRequestType 网络请求方式
 *  @param baseUrl            基础URL
 *  @param parameter          字典参数
 *  @param success            成功返回时,处理block
 *  @param failed             失败返回时,处理block
 */
- (void)sendRequestToServiceWithRequestType:(netWorkRequestType)netWorkRequestType
                                 andBaseUrl:(NSString *)baseUrl
                               andParameter:(NSDictionary *)parameter
           andServiceReceiveResponseSuccess:(serverResponseSuccess)success
               ServiceReceiveResponseFailed:(serverResponseFailed)failed;

/**
 *  上传图片
 *
 *  @param netWorkRequestType 网络请求方式
 *  @param baseUrl            基础URL
 *  @param parameter          字典参数
 *  @param imageDatas         图片二进制数组
 *  @param success            成功返回时,处理block
 *  @param failed             失败返回时,处理block
 */
- (void)sendRequestToServiceWithRequestType:(netWorkRequestType)netWorkRequestType
                                 andBaseUrl:(NSString *)baseUrl
                               andParameter:(NSDictionary *)parameter
                              andImageArr:(NSArray *)imageDatas
           andServiceReceiveResponseSuccess:(serverResponseSuccess)success
               ServiceReceiveResponseFailed:(serverResponseFailed)failed;

/**
 *  加密数据
 *
 *  @param parameter 需要加密的字典
 *
 *  @return 加密后字典
 */
- (NSDictionary *)encryptDataWithParameter:(NSDictionary *)parameter;

/**
 *  设置基础URL  eg:www.dolabank.com/app/user
 *
 *  @param url 基础URL分支  eg:app/user
 *
 *  @return 返回完整基础URL eg:www.dolabank.com/app/user
 */
- (NSString *)setBaseUrlWithBranchUrl:(NSString *)url;



@end
